Integrand size = 23, antiderivative size = 140 \[ \int (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\left (a^3 A-3 a A b^2-3 a^2 b B+b^3 B\right ) x-\frac {\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) \log (\cos (c+d x))}{d}+\frac {b \left (2 a A b+a^2 B-b^2 B\right ) \tan (c+d x)}{d}+\frac {(A b+a B) (a+b \tan (c+d x))^2}{2 d}+\frac {B (a+b \tan (c+d x))^3}{3 d} \]
[Out]
Time = 0.27 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3609, 3606, 3556} \[ \int (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {b \left (a^2 B+2 a A b-b^2 B\right ) \tan (c+d x)}{d}-\frac {\left (a^3 B+3 a^2 A b-3 a b^2 B-A b^3\right ) \log (\cos (c+d x))}{d}+x \left (a^3 A-3 a^2 b B-3 a A b^2+b^3 B\right )+\frac {(a B+A b) (a+b \tan (c+d x))^2}{2 d}+\frac {B (a+b \tan (c+d x))^3}{3 d} \]
[In]
[Out]
Rule 3556
Rule 3606
Rule 3609
Rubi steps \begin{align*} \text {integral}& = \frac {B (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x))^2 (a A-b B+(A b+a B) \tan (c+d x)) \, dx \\ & = \frac {(A b+a B) (a+b \tan (c+d x))^2}{2 d}+\frac {B (a+b \tan (c+d x))^3}{3 d}+\int (a+b \tan (c+d x)) \left (a^2 A-A b^2-2 a b B+\left (2 a A b+a^2 B-b^2 B\right ) \tan (c+d x)\right ) \, dx \\ & = \left (a^3 A-3 a A b^2-3 a^2 b B+b^3 B\right ) x+\frac {b \left (2 a A b+a^2 B-b^2 B\right ) \tan (c+d x)}{d}+\frac {(A b+a B) (a+b \tan (c+d x))^2}{2 d}+\frac {B (a+b \tan (c+d x))^3}{3 d}+\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) \int \tan (c+d x) \, dx \\ & = \left (a^3 A-3 a A b^2-3 a^2 b B+b^3 B\right ) x-\frac {\left (3 a^2 A b-A b^3+a^3 B-3 a b^2 B\right ) \log (\cos (c+d x))}{d}+\frac {b \left (2 a A b+a^2 B-b^2 B\right ) \tan (c+d x)}{d}+\frac {(A b+a B) (a+b \tan (c+d x))^2}{2 d}+\frac {B (a+b \tan (c+d x))^3}{3 d} \\ \end{align*}
Result contains complex when optimal does not.
Time = 1.04 (sec) , antiderivative size = 130, normalized size of antiderivative = 0.93 \[ \int (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {3 (a+i b)^3 (-i A+B) \log (i-\tan (c+d x))+3 (a-i b)^3 (i A+B) \log (i+\tan (c+d x))+6 b \left (3 a A b+3 a^2 B-b^2 B\right ) \tan (c+d x)+3 b^2 (A b+3 a B) \tan ^2(c+d x)+2 b^3 B \tan ^3(c+d x)}{6 d} \]
[In]
[Out]
Time = 0.07 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.01
method | result | size |
norman | \(\left (A \,a^{3}-3 A a \,b^{2}-3 B \,a^{2} b +B \,b^{3}\right ) x +\frac {b \left (3 A a b +3 B \,a^{2}-B \,b^{2}\right ) \tan \left (d x +c \right )}{d}+\frac {B \,b^{3} \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {b^{2} \left (A b +3 B a \right ) \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {\left (3 A \,a^{2} b -A \,b^{3}+B \,a^{3}-3 B a \,b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(141\) |
parts | \(A \,a^{3} x +\frac {\left (A \,b^{3}+3 B a \,b^{2}\right ) \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}\right )}{d}+\frac {\left (3 A a \,b^{2}+3 B \,a^{2} b \right ) \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {\left (3 A \,a^{2} b +B \,a^{3}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {B \,b^{3} \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) | \(147\) |
derivativedivides | \(\frac {\frac {B \,b^{3} \left (\tan ^{3}\left (d x +c \right )\right )}{3}+\frac {A \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+\frac {3 B a \,b^{2} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+3 A a \,b^{2} \tan \left (d x +c \right )+3 B \,a^{2} b \tan \left (d x +c \right )-B \,b^{3} \tan \left (d x +c \right )+\frac {\left (3 A \,a^{2} b -A \,b^{3}+B \,a^{3}-3 B a \,b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (A \,a^{3}-3 A a \,b^{2}-3 B \,a^{2} b +B \,b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(159\) |
default | \(\frac {\frac {B \,b^{3} \left (\tan ^{3}\left (d x +c \right )\right )}{3}+\frac {A \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+\frac {3 B a \,b^{2} \left (\tan ^{2}\left (d x +c \right )\right )}{2}+3 A a \,b^{2} \tan \left (d x +c \right )+3 B \,a^{2} b \tan \left (d x +c \right )-B \,b^{3} \tan \left (d x +c \right )+\frac {\left (3 A \,a^{2} b -A \,b^{3}+B \,a^{3}-3 B a \,b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (A \,a^{3}-3 A a \,b^{2}-3 B \,a^{2} b +B \,b^{3}\right ) \arctan \left (\tan \left (d x +c \right )\right )}{d}\) | \(159\) |
parallelrisch | \(\frac {2 B \,b^{3} \left (\tan ^{3}\left (d x +c \right )\right )+6 A x \,a^{3} d -18 A a \,b^{2} d x +3 A \,b^{3} \left (\tan ^{2}\left (d x +c \right )\right )-18 B \,a^{2} b d x +6 B \,b^{3} d x +9 B a \,b^{2} \left (\tan ^{2}\left (d x +c \right )\right )+9 A \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{2} b -3 A \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) b^{3}+18 A a \,b^{2} \tan \left (d x +c \right )+3 B \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{3}-9 B \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a \,b^{2}+18 B \,a^{2} b \tan \left (d x +c \right )-6 B \,b^{3} \tan \left (d x +c \right )}{6 d}\) | \(192\) |
risch | \(A \,a^{3} x -3 A a \,b^{2} x -3 B \,a^{2} b x +B \,b^{3} x +3 i A \,a^{2} b x +i B \,a^{3} x -3 i B a \,b^{2} x +\frac {6 i A \,a^{2} b c}{d}-\frac {6 i B a \,b^{2} c}{d}-i A \,b^{3} x +\frac {2 i a^{3} B c}{d}-\frac {2 i A \,b^{3} c}{d}+\frac {2 i b \left (9 A a b \,{\mathrm e}^{4 i \left (d x +c \right )}+9 B \,a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-6 B \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-3 i A \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-9 i B a b \,{\mathrm e}^{4 i \left (d x +c \right )}+18 A a b \,{\mathrm e}^{2 i \left (d x +c \right )}+18 B \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-6 B \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 i A \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-9 i B a b \,{\mathrm e}^{2 i \left (d x +c \right )}+9 A a b +9 B \,a^{2}-4 B \,b^{2}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {3 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) A \,a^{2} b}{d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) A \,b^{3}}{d}-\frac {a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B}{d}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B a \,b^{2}}{d}\) | \(383\) |
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.01 \[ \int (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {2 \, B b^{3} \tan \left (d x + c\right )^{3} + 6 \, {\left (A a^{3} - 3 \, B a^{2} b - 3 \, A a b^{2} + B b^{3}\right )} d x + 3 \, {\left (3 \, B a b^{2} + A b^{3}\right )} \tan \left (d x + c\right )^{2} - 3 \, {\left (B a^{3} + 3 \, A a^{2} b - 3 \, B a b^{2} - A b^{3}\right )} \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right ) + 6 \, {\left (3 \, B a^{2} b + 3 \, A a b^{2} - B b^{3}\right )} \tan \left (d x + c\right )}{6 \, d} \]
[In]
[Out]
Time = 0.14 (sec) , antiderivative size = 240, normalized size of antiderivative = 1.71 \[ \int (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\begin {cases} A a^{3} x + \frac {3 A a^{2} b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - 3 A a b^{2} x + \frac {3 A a b^{2} \tan {\left (c + d x \right )}}{d} - \frac {A b^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {A b^{3} \tan ^{2}{\left (c + d x \right )}}{2 d} + \frac {B a^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - 3 B a^{2} b x + \frac {3 B a^{2} b \tan {\left (c + d x \right )}}{d} - \frac {3 B a b^{2} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {3 B a b^{2} \tan ^{2}{\left (c + d x \right )}}{2 d} + B b^{3} x + \frac {B b^{3} \tan ^{3}{\left (c + d x \right )}}{3 d} - \frac {B b^{3} \tan {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (A + B \tan {\left (c \right )}\right ) \left (a + b \tan {\left (c \right )}\right )^{3} & \text {otherwise} \end {cases} \]
[In]
[Out]
none
Time = 0.33 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.02 \[ \int (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\frac {2 \, B b^{3} \tan \left (d x + c\right )^{3} + 3 \, {\left (3 \, B a b^{2} + A b^{3}\right )} \tan \left (d x + c\right )^{2} + 6 \, {\left (A a^{3} - 3 \, B a^{2} b - 3 \, A a b^{2} + B b^{3}\right )} {\left (d x + c\right )} + 3 \, {\left (B a^{3} + 3 \, A a^{2} b - 3 \, B a b^{2} - A b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) + 6 \, {\left (3 \, B a^{2} b + 3 \, A a b^{2} - B b^{3}\right )} \tan \left (d x + c\right )}{6 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 1751 vs. \(2 (136) = 272\).
Time = 1.40 (sec) , antiderivative size = 1751, normalized size of antiderivative = 12.51 \[ \int (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=\text {Too large to display} \]
[In]
[Out]
Time = 8.27 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.01 \[ \int (a+b \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx=x\,\left (A\,a^3-3\,B\,a^2\,b-3\,A\,a\,b^2+B\,b^3\right )-\frac {\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )\,\left (-\frac {B\,a^3}{2}-\frac {3\,A\,a^2\,b}{2}+\frac {3\,B\,a\,b^2}{2}+\frac {A\,b^3}{2}\right )}{d}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {A\,b^3}{2}+\frac {3\,B\,a\,b^2}{2}\right )}{d}-\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (B\,b^3-3\,a\,b\,\left (A\,b+B\,a\right )\right )}{d}+\frac {B\,b^3\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d} \]
[In]
[Out]